<template>
  <!-- 消息发布页面容器 -->
  <div style="height:100%">
    <!-- 引入发布导航组件 -->
    <publish-nav></publish-nav>
  </div>
</template>

<script>
// 导入发布导航组件
import PublishNav from "../../../components/message/PublishNav.vue";

export default {
  components: { PublishNav },  // 注册组件
  // 路由进入前守卫 - 检查登录状态
  beforeRouteEnter(to, from, next) {
    let token = window.localStorage.token;
    if (token == null || token == "" || token == undefined) {
      next("/login");  // 未登录跳转到登录页
    } else {
      next();  // 已登录继续访问
    }
  },
};
</script>